import { get, post } from './request';

/** 登录接口 POST /api/login/account */
export async function login(body: API.LoginParams) {
  return post<{ data: API.LoginResult }>('/login', body);
}

/** 退出登录接口 POST /api/login/outLogin */
export async function outLogin(options?: { [key: string]: any }) {
  return post<Record<string, any>>('/api/login/outLogin');
}

/** 发送验证码 POST /api/login/captcha */
export async function getFakeCaptcha(params: {
  // query
  /** 手机号 */
  phone?: string;
}) {
  return get<API.FakeCaptcha>('/api/login/captcha', params);
}

/** 获取当前的用户 GET /api/currentUser */
export async function currentUser(options?: { [key: string]: any }) {
  return get<{
    data: API.CurrentUser;
  }>('/api/user/current');
}
